import db from '~~/DB';
import { defineResponseResolver } from '~~/mocks/define';
import {} from 'msw';
import { validateMenu } from '~~/mocks/middleware/menu';

export default validateMenu('system-menu-add', async (req, res, ctx) => {
  const body = await req.json();
  const data = await db.menus.add(body);
  // toCollection().sortBy('sort');
  return res(ctx.json(data));
});
